import 'dart:typed_data';

import 'package:library_base/entities/bluetooth_device_entity.dart';
import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/device_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class DeviceEntity {

  late BluetoothDeviceEntity device;

  late int rssi;

  String getName(){
    return device.name??"";
  }

  DeviceEntity();

  factory DeviceEntity.fromJson(Map<String, dynamic> json) => $DeviceEntityFromJson(json);

  Map<String, dynamic> toJson() => $DeviceEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

}
